"""
@author: peng
@email: sb.peng@hzgosun.com
@file: alertDetailPage.py
@time: 2019/5/29 9:01

"""
from common.poium.poium import Page
from common.vue.button import VueButton
from common.vue.element import VueElements
from common.vue.float_window import FloatWindow
from common.vue.label import ElementType as ET, ElementBaseLabel
from common.vue.region import VueRegion
from common.vue.search import VueSearch
from common.vue.table import VueTable, VueTurnPage
from common.vue.tree import VueTree


class SearchTools(VueSearch):
    """查询警情管理"""
    alert_input = ElementBaseLabel(ET.INPUT, label="警情事件名称")  # 关键字后面的输入框
    start_time = ElementBaseLabel(ET.DATE_PICKER, "发起时间")
    end_time = ElementBaseLabel(ET.DATE_PICKER, "发起时间", date_picker_index=1)


    search_btn = VueButton("搜索")   # 查询按钮

    def __init__(self):
        super(SearchTools, self).__init__()

class Table(VueTable):
    """警情管理"""

    add_btn = VueButton("新增")

    def __init__(self):
        super(Table, self).__init__()

class AddAlertWindow(FloatWindow):
    """添加警情弹窗"""
    add_alert_people = ElementBaseLabel(ET.DROPDOWN_LIST, "发起人")
    # add_alert_people = VueElements(index=0)
    add_alert_people_input = ElementBaseLabel(ET.INPUT, "发起人")
    add_alert_time = ElementBaseLabel(ET.DATE_PICKER, "发起时间")
    add_alert_name = ElementBaseLabel(ET.INPUT, "警情名称")
    add_alert_region = ElementBaseLabel(ET.DROPDOWN_LIST, "小区选择")
    add_alert_content = ElementBaseLabel(ET.INPUT, "警情内容")
    add_alert_accessory = ElementBaseLabel(ET.UPLOAD, "警情附件")

    def __init__(self, title=None, index=None):
        super(AddAlertWindow, self).__init__(title=title, index=index)

class alertPage(Page):
    """人口管理页面"""
    searchTools = SearchTools()   # 查询区域
    table = Table()   # 列表
    turnPage = VueTurnPage()   # 翻页
    # addAlert = AddAlertWindow(title="新增")   #添加警情
    addAlert = AddAlertWindow(title="添加警情")  # 添加警情